package form.ui.component.List
{
	import form.ui.Label;

	public class BaseListRender extends Label implements IItemRender
	{
		private static const NAME:String = "form.ui.component.List::BaseListRender";
		
		public function BaseListRender()
		{
			super();
			this.textfield.mouseEnabled = false;
			this.width = 100;
		}
		
		public function get fullName():String
		{
			return NAME;
		}
		
		private var _data:Object;
		public function get data():Object
		{
			return _data;
		}
		
		public function set data(value:Object):void
		{
			if("label" in value && value.label != null) formValue = value.label;
			else formValue = value.toString();
			_data = value;
		}
		
		private var _owner:IListBase;
		public function get owner():IListBase
		{
			return _owner;
		}
		
		public function set owner(value:IListBase):void
		{
			_owner = value;
		}
		
		private var _selected:Boolean;
		public function get selected():Boolean
		{
			return _selected;
		}
		
		public function set selected(value:Boolean):void
		{
			_selected = value;
			if(value)
			{
				this.fillColor = 0x0099ff;
				this.fillOpacity = 1;
			}
			else
			{
				this.fillColor = 0xFFFFFF;
				this.fillOpacity = 0;
			}
		}
		
		public function invalidateDisplayList():void
		{
			
		}
	}
}